package easy;

import util.PrintUtils;

public class Solution_645 {

    public int[] findErrorNums(int[] nums) {
        int[] array = new int[nums.length];
        for (int num : nums) {
            array[num-1]++;
        }
        int[] res = new int[2];
        for (int i = 0; i < array.length; i++) {
            if (array[i] == 1) {
                continue;
            } else if (array[i] == 2) {
                res[0] = i + 1;
            } else {

                res[1] = i + 1;
            }
        }
        return res;
    }

    public static void main(String[] args) {
        Solution_645 model = new Solution_645();
        PrintUtils.arrayInt(model.findErrorNums(new int[]{1,2,2,4}));
        PrintUtils.arrayInt(model.findErrorNums(new int[]{1,1}));
        System.out.println(6^-6);
//        System.out.println(-7 / 4);
//        System.out.println(-7 % 4);
    }
}
